import bisect
from typing import *


class Solution:
    def maxPointsInsideSquare(self, points: List[List[int]], s: str) -> int:

        def f(width):
            st = set()
            for i, (a, b) in enumerate(points):
                if abs(a) <= width and abs(b) <= width:
                    if s[i] not in st:
                        st.add(s[i])
                    else:
                        return True
            return False

        wi = bisect.bisect_left(range(10**9 + 1), True, key=f)
        st = set()
        for i, (a, b) in enumerate(points):
            if abs(a) < wi and abs(b) < wi:
                if s[i] not in st:
                    st.add(s[i])
        return len(st)


s = Solution()
print(
    s.maxPointsInsideSquare(
        points=[[2, 2], [-1, -2], [-4, 4], [-3, 1], [3, -3]], s="abdca"
    )
)
